#!/bin/sh

[ "$ACTION" = ifup ] || exit 0
[ "$INTERFACE" = "wan" ] || exit 0

ipset -! -N "neteasemusic" hash:ip
sleep 10
wget-ssl -t 5 -T 10 "http://httpdns.n.netease.com/httpdns/v2/d?domain=music.163.com,interface.music.163.com,interface3.music.163.com,apm.music.163.com,apm3.music.163.com,clientlog.music.163.com,clientlog3.music.163.com" -O- |grep -Eo '[0-9]+?\.[0-9]+?\.[0-9]+?\.[0-9]+?' |sort |uniq |awk '{print "ipset add neteasemusic "$1}' |sh
